#!/bin/bash
# logup.sh
#
# Cleanup log files

LOG_DIR=/var/log
ROOT_UID=0     # Only users with $UID 0 have root privileges.
LINES=50       # Default number of lines saved.
E_XCD=66       # Can't change directory?
E_NOTROOT=67   # Non-root exit error.

echo "Logs cleaned up."


# Run as root, or it won't work :D
if [ "$UID" -ne "$ROOT_UID" ]; then
	echo "Must be root to run this script."
	exit $E_NOTROOT
fi  

cd $LOG_DIR || {
	echo "Cannot change to necessary directory $LOG_DIR." >&2
	exit $E_XCD;
}

cat /dev/null > messages
cat /dev/null > wtmp

exit 0
